﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="选择销售合同.aspx.cs" Inherits="syc.Store.选择销售合同" %>
<html>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>

<form id="form1" runat="server">
<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
    ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
    SelectCommand="SELECT 0 as [ID], '全部' as [名称] UNION SELECT [ID], [名称] FROM [产品订货单位]">
</asp:SqlDataSource>
<div id="wintop" class="wintop">第一步 选择销售合同</div>
<asp:Panel ID="Panel1" runat="server" CssClass="panel">
    <asp:Button ID="Button_NextStep" runat="server" Text="下一步..." CssClass="button" Enabled="false"
             UseSubmitBehavior="False" onclick="Button_NextStep_Click"/>
    <input type="button" value="关 闭" class="button" onclick="parent.swin_close();" />
</asp:Panel>
<asp:Panel ID="Panel2" runat="server" CssClass="panel" GroupingText="合同查询">

<asp:SqlDataSource ID="DS_ChanPin" runat="server" 
    ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
    SelectCommand="SELECT [ID],[品名]+' '+[钢级]+' '+[规格] AS 名称 FROM [产品]"></asp:SqlDataSource>
产品类别：<asp:DropDownList ID="ChanPin" runat="server" Width="150px" Font-Size="12px" DataSourceID="DS_ChanPin" DataTextField="名称" DataValueField="ID">

</asp:DropDownList>  
    <span style="display:inline-block;width:30px;"></span>
    订货单位：<asp:DropDownList ID="DingHuo" runat="server" 
        DataSourceID="SqlDataSource2" DataTextField="名称" DataValueField="ID" 
        Width="120px">
    </asp:DropDownList>
    <span style="display:inline-block;width:30px;"></span>
    收货单位：<asp:DropDownList ID="ShouHuo" runat="server" 
        DataSourceID="SqlDataSource2" DataTextField="名称" DataValueField="ID"  
        Width="120px">
    </asp:DropDownList>
    <span style="display:inline-block;width:30px;"></span>
    合同编号：<asp:TextBox ID="DanHao" runat="server" CssClass="textbox" Width="100px"></asp:TextBox>   
    <br />
    开始日期：<asp:TextBox ID="Date1" runat="server" CssClass="textbox" Width="120px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date1').value, document.getElementById('Date1'));" />
    <span style="display:inline-block;width:13px;"></span>
    结束日期：<asp:TextBox ID="Date2" runat="server" CssClass="textbox" Width="120px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date2').value, document.getElementById('Date2'));" />
    <span style="display:inline-block;width:40px;"></span>

    <asp:Button ID="Button_Query" runat="server" CssClass="mbutton" UseSubmitBehavior="false"
        onclick="Button_Query_Click" Text="查 询" />
    <asp:Button ID="Button_Reset" runat="server" CssClass="mbutton" UseSubmitBehavior="false"
         Text="复位选项" onclick="Button_Reset_Click" />
</asp:Panel>

<div class="gridframe">
    <div class="gridview">
    
        <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#e5cfab">
            <tr>
	            <td class="grid-title">销售合同</td>
	        </tr>
	        <tr>
	            <td class="grid-back">
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
                        onselected="SqlDataSource1_Selected" ></asp:SqlDataSource>
                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                         AutoGenerateColumns="False" CssClass="grid" DataKeyNames="ID" 
                        DataSourceID="SqlDataSource1" 
                        GridLines="None" ondatabound="GridView1_DataBound" 
                        onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
                        UseAccessibleHeader="False" 
                        onselectedindexchanged="GridView1_SelectedIndexChanged" >
                        <PagerSettings Visible="False" />
                        <RowStyle CssClass="grid-row-normal" />
                        <SelectedRowStyle   CssClass="grid-row-bright" />
                        <Columns>
                         <asp:TemplateField HeaderText="">
                                <ItemTemplate>
                                    <asp:Button ID="Button1" runat="server" CommandName="Select" Text="选择" CssClass="hide"/>
                                    <img src="/Icons/online.gif" style="margin-top:2px;" alt="" />
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="20px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="合同编号" SortExpression="合同编号">
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("合同编号") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="订货单位" SortExpression="订货单位">
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("订货单位") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="120px" />
                            </asp:TemplateField>
                            
                             <asp:TemplateField HeaderText="收货单位" SortExpression="收货单位">
                                <ItemTemplate>
                                    <asp:Label ID="Label20" runat="server" Text='<%# Bind("收货单位") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="120px" />
                            </asp:TemplateField>
                
                            <asp:TemplateField HeaderText="产品" SortExpression="产品">
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("产品") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                            </asp:TemplateField>
               
                            <asp:TemplateField HeaderText="订货量(吨)" SortExpression="订货量">
                                <ItemTemplate>
                                    <asp:Label ID="Label4" runat="server" Text='<%# Bind("订货量") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="90px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="发货量(吨)" SortExpression="发货量">
                                <ItemTemplate>
                                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("发货量","{0:0.0000}") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="90px" />
                            </asp:TemplateField>
                              
                            <asp:TemplateField HeaderText="日期" SortExpression="日期">
                                <ItemTemplate>
                                    <asp:Label ID="Label6" runat="server" Text='<%# Bind("日期","{0:d}") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="70px" />
                            </asp:TemplateField>
                            
                        </Columns>
                      </asp:GridView>
	            </td>
            </tr>
            <tr>
	            <td>   
	                <table width="100%">
	                    <tr>
	                        <td class="pagebar">
                                <asp:Button ID="Button_Pager_First" runat="server" Text="" ToolTip="首页" 
                                    CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                                <asp:Button ID="Button_Pager_Prev" runat="server" Text="" ToolTip="上一页" 
                                    CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                                <input type="button" class="page-split" />第<asp:TextBox ID="TextBox_Pager" runat="server" CssClass="pageturn" 
                                    ontextchanged="Pager_Click"></asp:TextBox>页<input type="button" class="page-split" /><asp:Label ID="Label_Pages" runat="server"></asp:Label><input type="button" class="page-split" />
                                
                                <asp:Button ID="Button_Pager_Next" runat="server" Text="" ToolTip="下一页" 
                                    CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                                <asp:Button ID="Button_Pager_Last" runat="server" Text="" ToolTip="末页" 
                                    CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" />
                            </td>
                            <td class="pagebar" align="right">
                                <asp:Label ID="Label_Total" runat="server" CssClass="grid_totalrows"></asp:Label>
                            </td>
                        </tr>
                   </table>

	            </td>
            </tr>
        </table>
        

    </div>
</div>

</form>
<script>
var i;
var rows = document.getElementsByTagName("tr");
for (i = 0; i < rows.length; i++) {

    if (rows[i].className == "grid-row-normal") {
        rows[i].onmouseover = function() { this.className = "grid-row-bright"; };
        rows[i].onmouseout = function() { this.className = "grid-row-normal"; };
        rows[i].onclick = function() { this.firstChild.firstChild.click(); };
    }
}
document.onkeydown = function(e) {
    if (!e) e = window.event;
    var tag = e.srcElement;
    if (!tag) tag = e.target;
    if (tag.tagName != "INPUT" || tag.className != "textbox") return;
    if (e.keyCode == 13) e.keyCode = 9;
}
</script>
</body>
</html>
